arr=[86,86,86,86,87,87,87,87]

#返回所有众数
def mymode(arr):
	d=dict()
	result=set()
	for item in arr:
		if item in d.keys():
			d[item]+=1
		else:
			d[item]=1
		if len(result)==0:
			result.add(item)
		else:
			pop=result.pop()
			if d[pop]==d[item]:
				result.add(pop)
				result.add(item)
			elif d[pop]>d[item]:
				result=set([item])
	return result,d
	
result,d=mymode(arr)
print(result)
print(d)
